package com.singzi.leetcode.N1500;

import java.util.HashSet;

public class T1446 {
    public static void main(String[] args) {
        Solution1446 solution0400 = new Solution1446();
        System.out.println(solution0400.maxPower("cc"));
    }
}
class Solution1446 {
    public int maxPower(String s) {
        HashSet<Character> set = new HashSet<Character>();
        set.remove('a');

        int max = 1;
        int temp = 1;
        char flag = s.charAt(0);
        for(int i = 1;i < s.length();i++){
            if(s.charAt(i)==flag){
                temp+=1;
            }
            else{
                if(temp>max) max = temp;
                flag = s.charAt(i);
                temp = 1;
            }

        }
//        System.out.println(Arrays.toString(index));


        return Math.max(max, temp);
    }

}